package com.gliese.bambook.util;

import java.util.Vector;

import org.htmlparser.Attribute;
import org.htmlparser.tags.Html;

public class HtmlTagForbam extends Html {
	@Override
	public String toTagHtml() {
		int length;
		int size;
		Vector attributes;
		Attribute attribute;
		StringBuffer ret;

		length = 2;
		attributes = getAttributesEx();
		size = attributes.size();
		for (int i = 0; i < size; i++) {
			attribute = (Attribute) attributes.elementAt(i);
			length += attribute.getLength();
		}
		ret = new StringBuffer(length);
		ret.append("<");
		for (int i = 0; i < size; i++) {
			attribute = (Attribute) attributes.elementAt(i);
			if(attribute.getName()!=null&&(attribute.getName().toLowerCase()).equals("xmlns"))break;
			attribute.toString(ret);
		}
		ret.append(">");

		return (ret.toString());
	}

}
